﻿using System.Collections.Generic;
using System.Linq;

namespace Behaviorize.Reporting.Model
{
	internal class Namespace : INamespaceAndFeatureContainer
	{
		public string Name { get; set; }
		public int Passed { get { return Namespaces.Sum(f => f.Passed) + Features.Sum(f => f.Passed); } }
		public int Pending { get { return Namespaces.Sum(f => f.Pending) + Features.Sum(f => f.Pending); } }
		public int Failed { get { return Namespaces.Sum(f => f.Failed) + Features.Sum(f => f.Failed); } }
		public List<Feature> Features { get; set; }
		public List<Namespace> Namespaces { get; set; }

		public Namespace()
		{
			Namespaces = new List<Namespace>();
			Features = new List<Feature>();
		}
	}
}